package com.hundsun.cprs.yyt.service.excel.service.impl;

import com.hundsun.cprs.yyt.common.base.BaseService;
import com.hundsun.cprs.yyt.service.excel.dao.ExcelRecordDao;
import com.hundsun.cprs.yyt.service.excel.domain.ExcelRecord;
import com.hundsun.cprs.yyt.service.excel.domain.query.ExcelRecordQuery;
import com.hundsun.cprs.yyt.service.excel.service.ExcelRecordService;
import com.hundsun.cprs.yyt.service.excel.domain.query.ExcelRecordQuery;
import com.hundsun.cprs.yyt.service.excel.service.ExcelRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExcelRecordServiceImpl extends BaseService implements ExcelRecordService {

    @Autowired
    private ExcelRecordDao excelRecordDao;

    @Override
    public void createExcelRecord(ExcelRecord excelRecord) {
        excelRecordDao.insert(excelRecord);
    }

    @Override
    public void queryByPage(ExcelRecordQuery query) {
        List<ExcelRecord> excelRecordList = excelRecordDao.queryByPage(query);
        query.compatible(excelRecordList);
    }

    @Override
    public ExcelRecord getExcelRecordById(Long id) {
        return excelRecordDao.selectByPrimaryKey(id);
    }

    @Override
    public void modifyExcelRecord(ExcelRecord excelRecord) {
        excelRecordDao.modifyRecord(excelRecord);
    }
}
